package com.sumainfor.wx.system.maket.controller.rentadviser;

import com.sumainfor.common.util.JsonResult;
import com.sumainfor.wx.system.maket.service.SourceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * 业主来源
 * @author zhoucong
 * @data 2019/8/8
 * @Param
 * @return
 */
@RestController
@RequestMapping("/so")
public class SourceController {

    @Autowired
    SourceService sourceService;

     /**
      *  获取业主来源列表
      * @author zhoucong
      * @data 2019/8/8
      * @Param
      * @return
      */
    @GetMapping("/SelectSourceList")
    public JsonResult SelectSourceList(){
        JsonResult result=new JsonResult();
        List<Map<String,Object>> SelectSourceList=sourceService.SelectSourceList();
        if(SelectSourceList.size()<=0){
            result.putFailed("暂无业主来源！");
        }else{
            result.put(SelectSourceList);
        }
        return result;
    }

}
